<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Model.Mobile"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
       
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="SHORTCUT ICON" href="image/shrotcuticon.png"></link>
        <title>Mobile Shop</title>

        <link href="css/style.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="menu/menu_style.css" />
        <link rel="stylesheet" href="slide/nivo-slider.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="slide/style.css" type="text/css"/>
        <script type="text/javascript" src="slide/scripts/jquery-1.4.3.min.js"></script>
        <script type="text/javascript" src="slide/jquery.nivo.slider.pack.js"></script>
         <script type="text/javascript" src="menu/stmenu.js"></script>

        <script type="text/javascript">
            $(window).load(function() {
                $('#slider').nivoSlider();
            });
        </script>
        <script type="text/javascript" src="tooltip/jtip.js"></script>
        <link href="tooltip/css/global.css" rel="stylesheet" type="text/css" />

    </head>

    <body>
        <a name="top" id="top"></a>
        <div id="frame">
            <div id="page">
                <div id="header">
                    <%@include file="header.jsp"  %>
                    <%@include file="menu.jsp" %>

                </div>
                <!--        end header -->
                <div id="content">
                    <%@include file="leftpane.jsp" %>
                    <!--end leftside -->


                    <div id="rightside">
                        <%@include file="slide.jsp" %>
                        <%   
                        
                        request.setCharacterEncoding("utf-8");
                        Mobile mobile = new Mobile();
                        ArrayList<Mobile> listMobile=( ArrayList<Mobile>) request.getAttribute("listMobile");
                                  
                                //    int producerID = 0;
                                 //   if (request.getParameter("producer") != null) {
                                  //      producerID = Integer.parseInt(request.getParameter("producer"));
                                 //   }
                                //    ArrayList<Mobile> listMobile = mobile.getMobileByManufacturer(producerID);
                                    String name = request.getParameter("name");
                                    int k = 0;
                                    if(listMobile.size()==0){
                        %>
                        <div align="center" ><h4 style="font-weight: bold;color: #0066CC;margin-top: 100px;"> Loại điện thoại của nhà sản xuất này hiện chưa có tại cửa hàng chúng tôi</h4></div>
                        <%}else{%>

                        <div id="viewproducer" style="margin-left:5px;margin-top:50px;">
                            <div class="box_header">
                                <h4 class="title_center"><%=name%></h4>
                            </div >
                            <div class="box_center">
                                <table width="100%" border="0" cellspacing="5" cellpadding="5">
                                    <%
                                                int i = 0;
                                                while (i < listMobile.size()) {
                                                    int j = 0;
                                    %>
                                    <tr>
                                        <% while (j < 3 && i < listMobile.size()) {%>

                                        <td>

                                            <div class="itemoff" onmouseover="className='itemon';" onmouseout="className='itemoff';">

                                                   <div class="image">
                                    <img width="59" height="88" src="<%=listMobile.get(i).getAnhDaiDien()%>" border="0" /> </div>
                                                    <div class="name">
                                                        <a href="tooltip/tooltipmobile.jsp?id=<%=listMobile.get(i).getMobileID()%>"
                                                           name=" <%=listMobile.get(i).getTenSP()%>" id="<%=k++%>" class="jTip">
                                                            <%=listMobile.get(i).getTenSP()%>
                                                        </a>
                                                    </div>
                                                     <div class="giaa" style="background-image:url('image/bg-price.png');background-repeat: no-repeat;height: 29px;width: 139px;margin: auto; padding-top: 6px;color: white;"> <strong><%= listMobile.get(i).formatedPrice()%> VND</strong> </div>
                              				  		 <div class="chitiet"><a href="DetailProduct?mobileID=<%=listMobile.get(i).getMobileID()%>"><img src="image/bg-nutchitiet.png"></a></div>
                              				  		  <div class="dathang"><a href="Order?mobileID=<%=listMobile.get(i).getMobileID()%>"><img src="image/bg-nutgiohang.png"></a></div>
                                            </div>

                                        </td>

                                        <% j++;
                                           i++;
                                        }%>
                                    </tr>
                                    <% }%>

                                </table>

                            </div>

                        </div>
                        <%}%>




                    </div>

                    <!--        end rightside -->


                </div>
                <!--    end content -->
            </div>
            <%@include file="footer.jsp" %>
            <!--    end page -->
        </div>
    </body>
</html>


